package com.yxinsur.imc.business.enums;

import com.yxinsur.imc.common.utils.StringUtils;
import lombok.Getter;

@Getter
public enum NationEnum {

    A("1|汉族","汉族"),
    B("10|朝鲜族","朝鲜族"),
    C("11|满族","满族"),
    D("12|侗族","侗族"),
    E("13|瑶族","瑶族"),
    F("14|白族","白族"),
    G("15|土家族","土家族"),
    H("16|哈尼族","哈尼族"),
    I("17|哈萨克族","哈萨克族"),
    J("18|傣族","傣族"),
    K("19|黎族","黎族"),
    L("2|蒙古族","蒙古族"),
    M("20|傈僳族","傈僳族"),
    N("21|佤族","佤族"),
    O("22|畲族","畲族"),
    P("23|高山族","高山族"),
    Q("24|拉祜族","拉祜族"),
    R("25|水族","水族"),
    S("26|东乡族","东乡族"),
    T("27|纳西族","纳西族"),
    U("28|景颇族","景颇族"),
    V("29|柯尔克孜族","柯尔克孜族"),
    W("3|回族","回族"),
    X("30|土族","土族"),
    Y("31|达斡尔族","达斡尔族"),
    Z("32|仫佬族","仫佬族"),
    AA("33|羌族","羌族"),
    AB("34|布朗族","布朗族"),
    AC("35|撒拉族","撒拉族"),
    AD("36|毛难族","毛难族"),
    AE("37|仡佬族","仡佬族"),
    AF("38|锡伯族","锡伯族"),
    AG("39|阿昌族","阿昌族"),
    AH("4|藏族","藏族"),
    AI("40|普米族","普米族"),
    AJ("41|塔吉克族","塔吉克族"),
    AK("42|怒族","怒族"),
    AL("43|乌孜别克族","乌孜别克族"),
    AM("44|俄罗斯族","俄罗斯族"),
    AN("45|鄂温克族","鄂温克族"),
    AO("46|崩龙族","崩龙族"),
    AP("47|保安族","保安族"),
    AQ("48|裕固族","裕固族"),
    AR("49|京族","京族"),
    AS("5|维吾尔族","维吾尔族"),
    AT("50|塔塔尔族","塔塔尔族"),
    AU("51|独龙族","独龙族"),
    AV("52|鄂伦春族","鄂伦春族"),
    AW("53|赫哲族","赫哲族"),
    AX("54|门巴族","门巴族"),
    AY("55|珞巴族","珞巴族"),
    AZ("56|基诺族","基诺族"),
    BA("6|苗族","苗族"),
    BB("7|彝族","彝族"),
    BC("8|壮族","壮族"),
    BD("9|布依族","布依族"),
    BE("97|其他","其他"),
    BF("98|外国血统","外国血统");

    private String keyNames;

    private String keyName;

    private NationEnum(String keyNames, String keyName) {
        this.keyNames = keyNames;
        this.keyName = keyName;
    }

    public String getKeyNames() {
        return keyNames;
    }

    public String getKeyName() {
        return keyName;
    }

    public static String getValueByKeyName(String keyName) {
        String keyValue = null;
        if (StringUtils.isNotBlank(keyName)) {
            for (PapersType c : PapersType.values()) {
                if (c.getKeyNames().contains(keyName)) {
                    keyValue = c.name();
                    break;
                }
            }
        }
        return keyValue;
    }

    public static String getKeyNameByValue(String value) {
        String keyValue = null;
        if (StringUtils.isNotBlank(value)) {
            for (PapersType c : PapersType.values()) {
                if (c.getKeyNames().contains(value)) {
                    keyValue = c.getKeyName();
                }
            }
        }
        return keyValue;
    }
}
